package dao;



/**
 * @author StockPro
 */
public abstract class DAOFactory {

	private static AlunoDAO alunoDAO;

	public static AlunoDAO getAlunoDAO() {
		if (alunoDAO == null) {
			alunoDAO = new AlunoDaoImp();
		}

		if (alunoDAO.isConnectionClose()) {
			alunoDAO.openConnection();
		}

		return alunoDAO;
	}
	private static TurmaDAO turmaDAO;
	
	public static TurmaDAO getTurmaDAO(){
		if(turmaDAO == null){
			turmaDAO = new TurmaDaoImp();
		}
		if(turmaDAO.isConnectionClose()){
			turmaDAO.openConnection();
		}return turmaDAO;
	}

private static AulaDAO aulaDAO;
	
	public static AulaDAO getAulaDAO(){
		if(aulaDAO == null){
			aulaDAO = new AulaDaoImp();
		}
		if(aulaDAO.isConnectionClose()){
			aulaDAO.openConnection();
		}return aulaDAO;
	}
	
private static FrequenciaDAO frequenciaDAO;
	
	public static FrequenciaDAO getFrequenciaDAO(){
		if(frequenciaDAO == null){
			frequenciaDAO = new FrequenciaDaoImp();
		}
		if(frequenciaDAO.isConnectionClose()){
			frequenciaDAO.openConnection();
		}return frequenciaDAO;
	}
}
